//
//  SRSportHeaderView.m
//  SportRing
//
//  Created by elwin on 10/29/14.
//  Copyright (c) 2014 HotOne. All rights reserved.
//

#import "SRSportHeaderView.h"

#define TEXT_SIZE 20

@implementation SRSportHeaderViewModel



@end

@interface SRSportHeaderView()

@property (nonatomic, weak)IBOutlet UILabel *averageTemperatureLabel;
@property (nonatomic, weak)IBOutlet UILabel *EGL;

@end

@implementation SRSportHeaderView


- (void)awakeFromNib
{
    [super awakeFromNib];
}

- (void)setSRSportHeaderViewDataWithModel:(SRSportHeaderViewModel *)model
{
    NSAttributedString *averageTemperature = [SRHelper attString:[NSString stringWithFormat:@"%@℃",model.averageTemperature]
                                         fromString:[[NSMutableArray alloc] initWithObjects:@"", nil]
                                           toString:[[NSMutableArray alloc] initWithObjects:@"℃", nil]
                                           fontSize:[[NSMutableArray alloc] initWithObjects:[UIFont systemFontOfSize:TEXT_SIZE], nil]
                                              color:[[NSMutableArray alloc] initWithObjects:self.averageTemperatureLabel.textColor, nil]];
    self.averageTemperatureLabel.attributedText = averageTemperature;
    
    NSAttributedString *EGL = [SRHelper attString:[NSString stringWithFormat:@"%@m",model.EGL]
                                                      fromString:[[NSMutableArray alloc] initWithObjects:@"", nil]
                                                        toString:[[NSMutableArray alloc] initWithObjects:@"m", nil]
                                                        fontSize:[[NSMutableArray alloc] initWithObjects:[UIFont systemFontOfSize:TEXT_SIZE], nil]
                                                           color:[[NSMutableArray alloc] initWithObjects:self.averageTemperatureLabel.textColor, nil]];
    self.EGL.attributedText = EGL;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
